TxnUtil

object TxnUtil

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val TXN_TYPE_BUY: Int = 0
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Apply any VAT/GST transformation (ie adding/adjusting splits) to the given transaction.

Link copied to clipboard
Link copied to clipboard
fun copyFromSimilarPreviousTxn(target: ParentTxn, source: ParentTxn, adjustAmounts: Boolean)

Copies the descriptions/memos, categories and amounts from the given source transaction, optionally adjusting the amounts to match the current target transaction value.

Link copied to clipboard

Copy any VAT/GST-related tags from one split to another. This should only be used when duplicating transactions (ie for auto-completion) for which you would like the VAT/GST status to also be transferred.

Link copied to clipboard

Find the matching VAT/GST split, if any, for the given split under the given parent txn. Note: Available as of build 312.

Link copied to clipboard

Get the part of the transaction that doesn't go to a security. (ie. the commission expense).

Link copied to clipboard

Get the part of the transaction that is expense.

Link copied to clipboard

Get the part of the transaction that is income.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Return a list of non-numeric string values that have appeared in the check number field for transactions in the given account, or if accountFilter is null then in any account. This will return no more than 200 entries.

fun getListOfAllNonNumericCheckNumbers(book: AccountBook, accountFilter: Account?, maximumAmount: Int): List<String>

Return a list of non-numeric string values that have appeared in the check number field for transactions in the given account, or if accountFilter is null then in any account. This will return no more than maximumAmount entries.

Link copied to clipboard
fun getNumShares(txnSet: TxnSet?, split: SplitTxn?): Long

As of Build 256. This method returns the number of shares accounted for.

Link copied to clipboard
Link copied to clipboard

Get the part of the transaction that goes to a security account.

Link copied to clipboard
Link copied to clipboard

Get the part of the transaction that goes to another bank account.

Link copied to clipboard
fun markOnlineTxnsAsOf(txns: Iterator<AbstractTxn>, asOfDate: Int, statusFlag: Byte)

Mark transactions in the given enumeration with the given status flag if they fall on or before the given date. Note: This method fires a txn-modified event for every transaction that is changed.

Link copied to clipboard

Return the best guess for the kind of media contained in the given file

Link copied to clipboard

This is only available on Build 256 and up. This returns the set of buy transactions matched with the given sell transaction. The key is a string with the transaction ID, the value is the number of shares from that transaction.

Link copied to clipboard

Tag the given split as the commission/fee part of its investment transaction. This also un-tags any other splits as the commission part of the same transaction. Added in build 302

Link copied to clipboard

Tag the given split as the expense part of its investment transaction. This also un-tags any other splits as the expense part of the same transaction. Added in build 302

Link copied to clipboard

Tag the given split as the income part of its investment transaction. This also un-tags any other splits as the income part of the same transaction. Added in build 302

Link copied to clipboard

Tag the given (investment) transaction with the given transaction type

Link copied to clipboard

If the given transaction contains any inter-currency (or security to/from currency) elements, adjust the rates based on the the currency and security rate/price tables at the time of the transaction. Note: This is only available in build 794 and later.

Link copied to clipboard

Tag the given split as the security part of its investment transaction. This also un-tags any other splits as the security part of the same transaction. Added in build 302

Link copied to clipboard
fun setXfrPart(xfrSplit: SplitTxn?)

Tag the given split as the transfer part of its investment transaction. This also un-tags any other splits as the transfer part of the same transaction. Added in build 302

Link copied to clipboard

Return whether all parts of the given transaction are cleared for archiving.

Link copied to clipboard

Return true iff this transaction is a transfer to, from or within an investment account.

Link copied to clipboard

Returns true if the given transaction was downloaded, or imported from a downloaded file.